<div class="double">
    <div class="outline">
        <div class="title">
            <h3>{$Think.lang.point_exchange}</h3>
        </div>
        {if !empty($recommend_voucher) && !empty($recommend_pointsprod)}
        <div class="dsm-favorites-goods">
            <ul class="ds-carousel-skin">
                {foreach name="recommend_voucher" item="v" }
                <li style='width: 155px;float:left'>
                    <div class="dsm-goods-thumb-120"><a target="_blank" href="javascript:void(0);" ds_type="exchangebtn" data-param='{"vid":"{$v.vouchertemplate_id}"}'><img src="{$v.vouchertemplate_customimg}" onerror="this.src='{$Think.UPLOAD_SITE_URL}{:default_goodsimage(240)}'"></a>
                        <div class="dsm-goods-price"><em>{$v.vouchertemplate_points}{$Think.lang.points_unit}</em></div>
                    </div>
                    <div class="dsm-goods-name"><a target="_blank" href="javascript:void(0);" ds_type="exchangebtn" data-param='{"vid":"{$v.vouchertemplate_id}"}' title="{$Think.lang.currency}{$v.vouchertemplate_price}{$Think.lang.ds_vouchers}">{$Think.lang.currency}{$v.vouchertemplate_price}{$Think.lang.ds_vouchers}</a></div>
                </li>
                {/foreach}
                {foreach name="recommend_pointsprod" item="v"  }
                <li style='width: 155px;float:left'>
                    <div class="dsm-goods-thumb-120"><a href="{:url('Pointprod/pinfo',['id'=>$v.pgoods_id])}" target="_blank" tile="{$v.pgoods_name}"><img src="{$v.pgoods_image}"></a>
                        <div class="dsm-goods-price"><em>{$v.pgoods_points}{$Think.lang.points_unit}</em></div>
                    </div>
                    <div class="dsm-goods-name"><a href="{:url('Pointprod/pinfo',['id'=>$v.pgoods_id])}" target="_blank" tile="{$v.pgoods_name}">{$v.pgoods_name}</a></div>
                </li>
                {/foreach}
            </ul>
            <div class="more"><a target="_blank" href="{:url('Pointshop/index')}">{$Think.lang.enter_points_mall}</a></div>
        </div>
        {else/}
        <dl class="null-tip">
            <dt class="iconfont" style="font-size: 38px;color: #ccc">&#xe6e5;</dt>
            <dd>
                <h4>{$Think.lang.points_exchange_voucher}</h4>
                <h5>{$Think.lang.show_points_redeem_vouchers}</h5>
            </dd>
        </dl>
        {/if}
    </div>
</div>

<script>
$(function(){
	//代金券兑换功能
    $("[ds_type='exchangebtn']").on('click',function(){
    	var data_str = $(this).attr('data-param');
	    eval( "data_str = "+data_str);
            {if session('is_login') != '1'}
            login_dialog();
            {else}
            ajax_form('vexchange', '{$Think.lang.home_voucher_exchangtitle}', "{:url('Pointvoucher/voucherexchange')}?vid="+data_str.vid, 550);
            {/if}
	    return false;
    });
});
</script>